Question: Question: 4 (25 marks) (a) Consider a 'Painter Details' database with four tables as given below Table Name: Country Table Name : Painter country_code I

 Question: 4 (25 marks) (a) Consider a 'Painter Details' database with
four tables as given below Table Name: Country Table Name : Painter
country_code I country.name painter_hun | painter_f name painter_gender country_code I US 10014

Question: 4 (25 marks) (a) Consider a 'Painter Details' database with four tables as given below Table Name: Country Table Name : Painter country_code I country.name painter_hun | painter_f name painter_gender country_code I US 10014 | josephine 10015! rose 211K 10016 all 3 1 Malaysia 18017 | nadia 10018 Itero 10019 I theresa INCON 4 | Singpore Table Name: Gallery gal_nun | gal_nane 18 I painter place 23 | arts us 24 | arts wonders Table Name: Paintings painting_num painting title painter_hun gal_num 20018 | down thunder 10016 20023 voniall roses 10015 20041 tired flounders 100161 2012 hasty exit 10015 20045 | plastic paradis 10015 21003 databse sunshin 100141 21005 | file system fol 10317 COODOOD Based on the tables given above, answer the following questions ) Write SQL syntax to create table 'Painter' with all necessary constraints. Also write an SQL syntax to set the initial value of the column (painter_num) to 10014 (painter_num is auto_increment) ii) Write an SQL syntax to modify the table Paintings and add an attribute "created_date [of type date). Also write an SQL syntax to change the attribute 'created_date to 'c_dt' for the 'Paintings' table. Finally, write an SQL syntax to remove the attribute "c_dt' from "Paintings table. ) Write an SQL statement which gives painting name and corresponding painter name and gallery name as below PAINTING I PAINTER dawn thunder ali vaniall roses rose tired flounders ali hasty exit rose plastic paradis rose dat abse sunshin josephine file system fol nadia | GALLERY painter place painter place arts us arts wonders painter place arts wonders painter place iv) Write an SQL statement which shows the list of paintings of each painter as given below PainterName | PaintingTitle JOSEPHINE databse sunshin ROSE vaniall roses, hasty,exit,plastic paradis ALI dawn thunder, tired flounders NADIA i file system fol v) Write an SQL statement that gives the painter name and number of paintings he has done as given below PainterName i count(*) JOSEPHINE ROSE ALI NADIA HNW vi) Write an SQL statement to remove table 'Gallery'. Also write an SQL to remove the database 'painter_details'. Finally, write an sql statement to change the name of the table 'Painter' to 'Painter_Details' vii) Write a stored procedure which gives list of painters belonging to the country'US' (21 Marks)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!