Docsity

My SQL - How to Insert Values from Another Table, Study notes of Computer Programming

Partial preview of the text

Download My SQL - How to Insert Values from Another Table and more Study notes Computer Programming in PDF only on Docsity!

STEPS:

  1. Create a Table. Skip this step if you've already created a table.
  2. Insert values into the table.

Result

  1. Create a new table.
  2. Insert values into the table.

Page 1

MySQL

How Insert Values from Another Table

Result: SYNTAX EXPLAINED: CREATE TABLE New_Profession ( Profession_ID INT NOT NULL AUTO_INCREMENT PRIMARY KEY, Profession VARCHAR(30) ); -just creating a new table called New_Profession. INSERT INTO New_Profession (Profession) -Profession column of New_Profession table will be filled up. SELECT profession FROM Profession -Select profession column from my Profession table GROUP BY Profession -To group it by Profession ORDER BY Profession; -To order it by profession SELECT * FROM New_Profession;

- To select all from the New_Profession table. Page 2 Created By: mju2022 | Feb 16,2022 | 8:32 AM | LNC