Advertisements
Advertisements
प्रश्न
Assume that you are working in the IT Department of a Creative Art Gallery (CAG), which sells different forms of art creations like Paintings, Sculptures etc. The data of Art Creations and Artists are kept in tables Articles and Artists respectively. Following are few records from these two tables:
Table: Articles |
||||
Code |
A_code |
Article |
Doc |
Price |
PL001 |
A0001 |
Painting |
2018-10-19 |
20000 |
SC028 |
A0004 |
Sculpture |
2021-01-15 |
16000 |
QL005 |
A0003 |
Quilling |
2024-04-24 |
3000 |
Table: Artists |
||||
A_Code |
Name |
Phone |
Email |
DOB |
A0001 |
Roy |
595923 |
[email protected] |
1986-10-12 |
A0002 |
Ghosh |
1122334 |
[email protected] |
1972-02-05 |
A0003 |
Gargi |
121212 |
[email protected] |
1996-03-22 |
A0004 |
Mustafa |
33333333 |
[email protected] |
2000-01-01 |
Note:
- The tables contain many more records than shown here.
- DOC is Date of Creation of an Article.
As an employee of CAG, you are required to write the SQL queries for the following:
- To display all the records from the
Articlestable in descending order of price. - To display the details of Articles which were created in the year
2020. - To display the structure of
Artiststable. -
- To display the name of all artists whose Article is
Paintingthrough Equi Join.
OR - To display the name of all Artists whose Article is
'Painting'through Natural Join.
- To display the name of all artists whose Article is
कोड लेखन
Advertisements
उत्तर
-
Select * from Articles order by Price desc; -
Select * from Articles where year(DOC) = 2020; -
Describe Artists;
-
Select t2.Name from Articles t1, Artists t2 where t1.A_Code = t2.A_Code and t1.Article = "Painting";OR
-
Select t1.Name from Articles t1 NATURAL JOIN Artists t2 where t1.Article = "Painting";
-
shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
