May 2020
Beginner
564 pages
14h 9m
English
To see if you can delete data via a view that has multiple tables, you need to set up a copy of an existing table so that you don't delete the data in 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;
Let's delete a value using the view we just created with ...
Read now
Unlock full access