write SQL querries for the following
a) create table artists containing following fields using appropriate data types.
field names: artists, song, movie, year release.
b) add 5 records.
c) display all the records of A.R. Rahman.
d) add a new column price.
e) set price to RS. 100 /- for all the records.
Answers
Answered by
3
a) To create a table named 'Artists'.
- Create table Artists(Artist varchar(40), Song varchar(40), Movie varchar(60), Year_release date);
b) Inserting 5 records.
- Insert into Artists values('NF', 'Paid My Dues', Null, '2019-12-04');
- Insert into Artists values('The Vamps, Sigala', 'We Don't Care', Null, '2018-07-13');
- Insert into Artists values('Zac Efron, Zendaya', 'Re-write The Stars', 'The Greatest Show', '2017-10-13');
- Insert into Artists values('Loren Gray', 'Queen', Null, '2018-06-04');
- Insert into Artists values('DaBaby, Roddy Rich', 'Rockstar', Null, '2020-03-21');
c) To display records from AR Rahman.
- Select * from Artists where Artist = 'AR Rahman';
d) To add a new column, 'Price'.
- Alter table Artists add Price int();
e) To set the price to 100 for all the records.
- Update Artists set Price = 100;
Similar questions