May 2020
Beginner
564 pages
14h 9m
English
You can insert data via a view that has multiple tables. First, you need to set up a copy of an existing table so you don't insert data into the original table. You can do that with the following query:
USE lahmansbaseballdb;DROP TABLE IF EXISTS collegeplaying_copy; CREATE TABLE collegeplaying_copySELECT * FROM collegeplaying;
Next, you can create a view with this new table in it with the following query:
USE lahmansbaseballdb;DROP VIEW IF EXISTS collegeplayingbyname; CREATE VIEW collegeplayingbyname AS SELECT namefirst, namelast, schoolid, yearid FROM collegeplaying_copy cINNER JOIN people p ON p.playerid = c.playerid;
You can see what the view contains by executing the following ...
Read now
Unlock full access