SQL and PL/SQL || Table Structure || Steem Alliance Community.
Hello Everyone,
Good night everyone, how are you, i hope you all guys will happy and good. By the grace of God, i am also good. Today i am here with new article of SQL and PL/SQL series in which i will cover table structures with selecting and modifying quries . in the previous article , i have already share the 4th different languages that are use for creating inserting and modifying data in table.
Lets start with the basics of SQL tables. In SQL, tables are data stored elements in database. It is used to organize and store data in a relational database. Each table consists of rows and columns where rows represents records and a column represents specific field of the record. In simple word, we can say that it is the shelf of closet to manage the cloth.
First of all, we will select table then dicuss on its structure data. you will see that data will store in the form of rows and columns. it is the first and initial step to learn sql and working in database field. in every project database is essential to store the data according to own requirement.
Select Statement.
Select statement is use to fetch the data from tables. The syntex of select statement is mentioned below. first of all , we look into its syntex and try to understand its structure.
SELECT * FROM TABLE_NAME
we will write the actual table name at the place of 'table_name'. Table creating and data inserting menthods into table has been discussed in the previous post. now we talk about the ( * ) symbol. it is use to get the whole attribute or fields from the table, in simple word word we can say that ( * ) symbol is used to get the specific columns of data rows from table.
for example , I have a table with name "CUSTOMER" and it have 5 fields. the name of fields are ID , NAME , DATE , AMMOUNT , PRODUCT. we suppose that the subjected dummy data exist in field of tables.
| ID | NAME | DATE_CREATION | AMMOUNT | PRODUCT |
|---|---|---|---|---|
| 1 | ALI SALEEM | 30-JAN-2021 | 930 RS | BALLON |
| 2 | Waseem | 10-JUN-2020 | 307 RS | Cake |
| 3 | Jogni | 11-JAN-2021 | 305 RS | mobile |
| 4 | king | 30-JAN-2023 | 340 RS | charger |
| 5 | vampire | 20-JAN-2019 | 230 RS | handfree |
| 6 | smith | 25-SEP-2001 | 340 RS | Cover |
if i want to get the whole data with all columns then we will use the * keyword. if we want to fetch first three columns then we will use its name at the place of * keyword.
Get colums by using alias
we will use the random alphabet or name to give the doublicated short name to table then this short name can also use to get the columns data. Alias are basically use to give any temporary name to tables or columns.
SELECT A.ID , A.NAME , A.DATE_CREATION FROM CUSTOMER A ;
'A' is the alias that i give the temporary name to table. With alias name and columns name, we will get the specific columns.
Result with query.
| ID | NAME | DATE_CREATION |
|---|---|---|
| 1 | ALI SALEEM | 30-JAN-2021 |
| 2 | Waseem | 10-JUN-2020 |
| 3 | Jogni | 11-JAN-2021 |
| 4 | king | 30-JAN-2023 |
| 5 | vampire | 20-JAN-2019 |
| 6 | smith | 25-SEP-2001 |
It would be my pleasure if you will share your opinion and reviews on this topic
Please cast witness vote to @bangla.Witness or set proxy to @rme.
_
Vote @bangla.witness as witness
Set Proxy @rme as proxy
Special Thanks.
Cc: @rme
Cc: @hungry-griffin
Cc: @pennsif
Thanks for giving your precious time to my post.
Follow | Upvote | Share | Comments
Follow me on Instagram.
Instagram
🆃🅷🅰️🅽🅺 🆈🅾️🆄