Last active
January 7, 2024 04:43
-
-
Save myselfshravan/73f199ddff959af67f57590173d1e8b1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- create a new database and switch to it using the following commands: | |
mysql> CREATE DATABASE school_db; | |
mysql> USE school_db; | |
CREATE TABLE students ( | |
id INT PRIMARY KEY AUTO_INCREMENT, | |
name VARCHAR(255), | |
usn VARCHAR(255), | |
semester INT, | |
age INT, | |
course VARCHAR(255), | |
dob DATE, | |
address VARCHAR(255) | |
); | |
-- Once the table is created, you can insert dummy data into it using the following SQL commands: | |
INSERT INTO students (name, usn, semester, age, course, dob, address) VALUES | |
('Mark Crane', '1MS16CS001', 5, 22, 'Computer Science', '2000-01-01', '123 Main St'), | |
('Natalia Smith', '1MS16CS002', 5, 23, 'Computer Science', '1999-01-01', '456 Elm St'), | |
('Gary Anderson', '1MS16CS003', 5, 24, 'Computer Science', '1998-01-01', '789 Oak St'), | |
('Joe Natsume', '1MS16EC001', 5, 22, 'Electronics', '2000-01-01', '123 Main St'), | |
('Sarah', '1MS16EC002', 5, 23, 'Electronics', '1999-01-01', '456 Elm St'), | |
('Peter', '1MS16EC003', 5, 24, 'Electronics', '1998-01-01', '789 Oak St'), | |
('Nathan', '1MS16EC004', 5, 24, 'Electronics', '1998-01-01', '789 Oak St'); | |
-- This will insert 7 rows of dummy data into the students table. | |
-- You can verify that the data has been inserted correctly by running a SELECT query as shown below: | |
SELECT * FROM students; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment