Advertisement
makispaiktis

Query 1 - Create a database and a table

Jun 6th, 2023 (edited)
1,010
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.51 KB | Source Code | 0 0
  1. CREATE DATABASE mytestdb
  2.  
  3. USE mytestdb
  4. CREATE TABLE mytesttable
  5. (
  6. rollno INT,
  7. firstname VARCHAR(50),
  8. lastname VARCHAR(50)
  9. )
  10.  
  11. USE mytestdb
  12. SELECT rollno, firstname, lastname FROM mytesttable
  13.  
  14. INSERT INTO mytesttable(rollno, firstname, lastname)
  15. VALUES(1, 'THOMAS', 'BOUFIKOS')
  16. INSERT INTO mytesttable(rollno, firstname, lastname)
  17. VALUES(2, 'Bill', 'Gates')
  18. INSERT INTO mytesttable(rollno, firstname, lastname)
  19. VALUES(3, 'Elon', 'Musk')
  20.  
  21. USE mytestdb
  22. SELECT rollno, firstname, lastname FROM mytesttable
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement