Home > database >  Introduction to SQL small white consulting "SQL will know will be" (fourth edition) "
Introduction to SQL small white consulting "SQL will know will be" (fourth edition) "

Time:09-28

SQL in self-study, have this handy "SQL will know will be" (fourth edition), and 2.2 in the book to retrieve a single column has the following statement

The SELECT prod_name
The FROM Products;

Then will display the output result,

I according to the process on your own computer operation, suggest no database selected, because there is no import corresponding Products table? I found in the appendix in this book download address, download the file with the populate. TXT, checked to see there is a corresponding "populate Products table" content, but could you tell me how this paragraph can be imported into the database for my subsequent practice using query?

Beginners, please advice, thank you first!
Download script about "the Populate Products table" that a specific content is as follows:

INSERT INTO Products (prod_id, vend_id, prod_name, prod_price, prod_desc)
VALUES (' BR01 ', 'BRS01', '8 inch teddy bear', 5.99, '8 inch teddy bear, comes with cap and jacket');
INSERT INTO Products (prod_id, vend_id, prod_name, prod_price, prod_desc)
VALUES (' BR02 ', 'BRS01', '12 inch teddy bear', 8.99, '12 inch teddy bear, comes with cap and jacket');
INSERT INTO Products (prod_id, vend_id, prod_name, prod_price, prod_desc)
VALUES (' BR03 ', 'BRS01', '18 inch teddy bear', 11.99, '18 inch teddy bear, comes with cap and jacket');
INSERT INTO Products (prod_id, vend_id, prod_name, prod_price, prod_desc)
VALUES (' BNBG01 ', 'DLL01', 'Fish bean bag toy', 3.49, 'Fish bean bag toy, complete with bean bag worms with which to feed it');
INSERT INTO Products (prod_id, vend_id, prod_name, prod_price, prod_desc)
VALUES (' BNBG02 ', 'DLL01', 'Bird bean bag toy', 3.49, "Bird bean bag toy, dense eggs are not included");
INSERT INTO Products (prod_id, vend_id, prod_name, prod_price, prod_desc)
VALUES (' BNBG03 ', 'DLL01', 'Rabbit bean bag toy', 3.49, "Rabbit bean bag toy, comes with bean bag carrots');
INSERT INTO Products (prod_id, vend_id, prod_name, prod_price, prod_desc)
VALUES (' RGAN01 ', 'DLL01', 'Raggedy Ann', 4.99 '18 inch Raggedy Ann doll,');
INSERT INTO Products (prod_id, vend_id, prod_name, prod_price, prod_desc)
VALUES (' RYL01 ', 'FNG01', 'the King doll', 9.49, '12 inch King doll with royal garments and crown');
INSERT INTO Products (prod_id, vend_id, prod_name, prod_price, prod_desc)
VALUES (' RYL02 ', 'FNG01', 'the Queen doll', 9.49, '12 inch Queen doll with royal garments and crown');

CodePudding user response:

Problem has been solved, feel a sense of accomplishment, a database is to CREATE their own, in accordance with the attached "CREATE. TXT" in the code to CREATE a new TABLE, and then through "the Populate. TXT" to insert the data line!

CodePudding user response:

To USE the DATABASE
  • Related