Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.21 KB | None | 0 0
  1. create database AAA;
  2. use AAA;
  3. create table produse
  4. (
  5. Producator char(1) not null,
  6. Model varchar(4) not null,
  7. Tip varchar(10) not null
  8.  
  9. );
  10.  
  11. create table PC_uri
  12. (
  13. Cod int not null,
  14. Model varchar(4) not null,
  15. Viteza decimal(3,0) not null,
  16. Ram decimal(3,0) not null,
  17. Hd decimal(2,0) not null,
  18. Cd varchar (3) not null,
  19. Pret float not null
  20.  
  21.  
  22. );
  23.  
  24. create table laptop_uri
  25. (
  26. Cod int not null,
  27. Model varchar(4) not null,
  28. Viteza decimal(3,0) not null,
  29. Ram decimal(3,0) not null,
  30. Hd decimal(2,0) not null,
  31. Pret float not null,
  32. Ecran int not null
  33.  
  34. );
  35.  
  36.  
  37. create table imprimante
  38. (
  39. Cod int not null,
  40. Model varchar(4) not null,
  41. Color char(2) not null,
  42. Tip varchar(6) not null,
  43. Pret float not null
  44.  
  45. );
  46.  
  47. INSERT INTO PC_uri VALUES ( 1, 1232, 500, 64 , 5, '12x', 600 ), ( 2, 1121, 750, 128, 14, '40x', 850 ),
  48. ( 3 , 1233, 500, 64, 5, '12x', 600 ), ( 4, 1121, 600, 128, 14, '40x', 850 ), ( 5, 1121, 600, 128, 8, '40x', 850 ),
  49. ( 6, 1233, 750, 128, 20, '50x', 950 ), ( 7, 1232, 500, 32, 10, '12x', 400 ), ( 8, 1232, 450, 64, 8, '24x', 350 ),
  50. ( 9, 1232, 450, 32, 10, '24x', 350 ), ( 10, 1260, 500, 32, 10, '12x', 350 ), ( 11, 1233, 900, 128, 40, '40x', 980 );
  51.  
  52.  
  53. insert into imprimante values (1, 1276, 'nu', 'Laser', 400), (2, 1433, 'da', 'Jet', 270), (3, 1434, 'da', 'Jet', 290),
  54. (4, 1401, 'nu', 'Matrix', 150), (5, 1408, 'nu', 'Matrix', 270), (6, 1288, 'nu', 'Laser', 400);
  55.  
  56.  
  57.  
  58. insert into produse values ('B', 1121, 'PC'), ('A', 1232, 'PC'), ('A', 1233, 'PC'), ('E', 1260, 'PC'), ('A', 1276, 'Imprimante'),
  59. ('D', 1288, 'Imprimante'), ('A', 1298, 'Laptop_uri'), ('C', 1321, 'Laptop_uri'), ('A', 1401, 'imprimante'), ('A', 1408, 'Imprimante'),
  60. ('D', 1433, 'Imprimante'), ('E', 1434, 'Imprimante'), ('B', 1750, 'Laptop_uri'), ('A', 1752, 'Laptop_uri'), ('E', 2111, 'PC'), ('E', 2112, 'PC');
  61.  
  62. insert into laptop_uri values
  63. (1,1298,350,32,4,700,11),(2,1231,500,64,8,970,12),
  64. (3,1750,750,128,12,1200,14),(4,1298,600,64,10,1050,15),
  65. (5,1752,750,128,10,1150,14),(6,1298,450,64,10,950,120);
  66.  
  67. select * from PC_uri
  68. show tables;
  69.  
  70. select * from imprimante
  71. show tables;
  72.  
  73. select * from produse
  74. show tables;
  75.  
  76. select * from laptop_uri
  77. show tables;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement