हिंदी

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. - Computer Science (Python)

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:

  1. To display all the records from the Articles table in descending order of price.
  2. To display the details of Articles which were created in the year 2020.
  3. To display the structure of Artists table.
    1. To display the name of all artists whose Article is Painting through Equi Join.
      OR
    2. To display the name of all Artists whose Article is 'Painting' through Natural Join.
कोड लेखन
Advertisements

उत्तर

  1. Select * from Articles order by Price desc;
    
  2. Select * from Articles where year(DOC) = 2020;
    
  3. Describe Artists;

    1. Select t2.Name from Articles t1, Artists t2 where t1.A_Code
      = t2.A_Code and t1.Article = "Painting";

      OR

    2. Select t1.Name from Articles t1 NATURAL JOIN Artists t2 where
      t1.Article = "Painting";
shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
2024-2025 (March) Set 4
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×