Bu'aan kutaa 12ffaa ba'eera; bu'aa kee eessatti akka ilaaltu

Boqonnaa 3 Teeknooloojii Odeeffannoo kutaa 12

Which columns, which rows: SELECT, WHERE and UPDATE

daqiiqaa 4 · Gaaffii qormaata darbe 2 hojjetaman

Kutaalee barnootaa

Barnoota achii jalqabee taphachiisuuf kutaa tokko tuqi.

Barnoota viidiyoo Temari daqiiqaa 4 boqonnaa 3 Teeknooloojii Odeeffannoo kutaa 12: Which columns, which rows: SELECT, WHERE and UPDATE. Barnoonni kun Afaan Ingiliziitiin.

Dabalata boqonnaa 3

Fuulli boqonnaa kanaa wanta Temari boqonnaa kana irratti qabu kan hafe qaba, fakkeenyaaf yaadannoo gabaabaa fi gaaffii shaakalaa deebii isaanii waliin.

Fuula boqonnaa 3 bani

Wanta barnoonni jedhu hunda

Jechoota barnootaa kutaa kutaan. Barnoota achii jalqabee taphachiisuuf yeroo tuqi.

0:00Introduction

A database answers exactly what you ask it. In SQL, one part of a command chooses the columns, and another part chooses the rows. Leave the second part out, and the command reaches every row in the table. Let's see how that works.

0:18SELECT chooses the columns

SQL is the language you use to work with a database. A query starts with SELECT, then the columns you want, then FROM, and the table's name. SELECT * FROM COURSE; The asterisk, the star, means all columns in the table.

It is the same as listing every field by name. To see only some columns, list them, separated by commas. SELECT S_Fname, S_sex, FROM STUDENT; And spell each field name exactly as it is in the table.

0:54WHERE chooses the rows

Now the rows. To keep only some records, add a WHERE clause. WHERE S_sex = 'male'; Now only the male students come back. Text like male goes inside single quotation marks.

WHERE can compare too: equal, greater than, less than, and you can join conditions with AND or OR. WHERE is optional. Without it, you get every record. So remember the split. SELECT chooses the columns. WHERE chooses the rows.

1:29Practice question 1Qormaata darbe

Here is a practice question. In an SQL SELECT statement, what does the asterisk symbol signify? Pause the video, and try it.

The asterisk after SELECT means all columns in the table. It is the same as listing every field by name. The answer is C. It has nothing to do with the primary key. Rows are chosen by WHERE, not by the star, so B is wrong too. And the star does not pick out number columns.

2:07UPDATE: WHERE decides how many

Now a command that changes data. UPDATE changes values in records that are already in a table. It does not add records, and it does not remove them. Look at this one. UPDATE Teacher, SET T_Salary = 15000, WHERE T_Salary < 10000; Only teachers earning less than ten thousand get the new salary.

Your book says it plainly. It is the WHERE clause that decides how many records are updated. So what if you leave WHERE out? Then the command changes the salary of every teacher in the table. DELETE works the same way. With no WHERE, it deletes all the records.

2:49Practice question 2Qormaata darbe

Try this one. A school administrator in Hawassa executes the following SQL command. UPDATE Teacher SET T_Salary = 15000; What is the result of running this command? Pause, and try it.

Look for the WHERE clause. There isn't one. With no WHERE to choose the rows, the update reaches every record. So every teacher's salary becomes fifteen thousand birr. The answer is B. A is wrong: nothing limits it to the first row. C is wrong: WHERE can be left out, and then it simply changes every row. And D would need a WHERE clause, like the one we saw.

3:40Summary

So remember. After SELECT, the star means all columns. The WHERE clause chooses the rows. And an UPDATE or a DELETE with no WHERE reaches every record in the table. Keep practising questions like these on Temari.et.

Boqonnaa kana appii keessatti shaakali

Temari boqonnaa kana gara shaakala yeroon daangeffametti jijjiira; utuu hojjettuu ni sirreessa; wanti si hin galinis barsiisaa AI tiin ni ibsama.

Bilisaan jalqabi

Temari.et appii Android qaba; Google Play irratti bilisaan argama.

SeeniHerrega kee bani