Page 128 - CodePilot V5.0 C8
P. 128

See the following tables:

                                                              Order Table
                                     Order_ID    Product_ID    Order_Quantity     Customer_Name
                                       O001         P101               2          Aarav Sharma

                                      O002          P102               1          Priya Patel
                                      O003          P101               1          Rahul Verma

                                      O004          P103               3          Sneha Iyer

                                                             Product Table
                                      Product_ID    Product_Name        Price      Stock_Quantity

                                         P101       Laptop             50000             20
                                         P102       Smartphone         25000             50

                                         P103       Headphones          1500            100
                                         P104       Mouse                800            200

                     Now, answer the following questions:
                     (a)  Name the primary key in the Product Table.

                     (b)  How many records or tuples exist in the Order Table.
                     (c)  Name the key that creates the relationship between the Order Table and the Product Table.





                         INTRODUCTION TO SQL


                  SQL stands for Structured Query Language. It is the standard language for managing relational
                  databases and performing various operations on the data in the tables. SQL enable us to store,
                  retrieve and manipulate data in the form of tables.



                                    High                                           Integrates
                       Easy to    Performance   Free of                Provides      with       Ensures     Enables
                        use         and         Cost        Offers       High       Various      Data      Multi-user
                                  Efficiency              Portability   Security   Platforms    Integrity    Access




                                                            Key Features of SQL





                   SQL was developed by IBM researchers Raymond Boyce and Donald Chamberlin in the 1970s.






                   126
                        CodePilot (V5.0)-VIII
   123   124   125   126   127   128   129   130   131   132   133