USER
Example
Section titled “Example”SELECT *FROM studentsWHERE grade = 'A';Output
Section titled “Output”| Student_ID | Name | Grade ||------------|-------|-------|| 1 | Alice | A || 3 | Emma | A || 6 | Mike | A |Explanation
Section titled “Explanation”In the provided SQL query, we select all fields from the ‘students’ table where the grade is ‘A’. The output is formatted into markdown to display the data in a table format. It shows that students with ID 1, 3, and 6, called Alice, Emma, and Mike respectively, have a grade ‘A’.
Example
Section titled “Example”SELECT ename, jobFROM empWHERE deptno=20;Output
Section titled “Output”ENAME JOB---------- ----------JONES MANAGERFORD ANALYSTSMITH CLERKExplanation
Section titled “Explanation”In the example above, the query selects ename (employee name) and job from the emp table where the deptno (department number) is 20. The output table displays the names and jobs of all employees in department 20.
Example
Section titled “Example”SELECT *FROM CustomersWHERE Country = 'USA';Output
Section titled “Output”| CustomerID | ContactName | Country | Phone ||------------|-------------|---------|-------------|| 1 | John Smith | USA | 123-456-789 || 2 | Jane Doe | USA | 098-765-432 |Explanation
Section titled “Explanation”In the SQL query, we select all fields (*) from the Customers table where the Country equals ‘USA’. The result of this query is outputted in a markdown table format, listing customers from the table ‘Customers’ that reside in ‘USA’.