Everyday SQL (13) interview question
We have 3 tables Orders table (ORDER_ID, CUSTOMER_ID, ORDER_DATE) Detail table (ORDER_ID, PRODUCT_ID, PRICE, UNITS) Customers table (CUSTOMER_ID, SIGNUP_DATE, COUNTRY) Data request: can you write […]
We have 3 tables Orders table (ORDER_ID, CUSTOMER_ID, ORDER_DATE) Detail table (ORDER_ID, PRODUCT_ID, PRICE, UNITS) Customers table (CUSTOMER_ID, SIGNUP_DATE, COUNTRY) Data request: can you write […]
data: code A1 A2 A11 A22 A111 A222 A3333 A4444 We want to select a data set as follows. A1 A2 A11 A22 A111 […]
Table name is dogs. The table includes columns 1. name varchar 2. breed varchar 3. weight float 4. color varchar 5. age int The dogs […]
I found there are lots of resource for SQL interview questions. It can help you on refreshing your knowledge of sql. Go through the below […]
When we get message similar as below, usually we did not indicate a table for that column. But sometimes it means you have written the […]
Add days, weeks, month, quarter, year to a date: use positive number #minus days, weeks, month, quarter, year from a date: use negative number Example […]
There are many interesting usage of sql function, like case when which is super powerful. Hope you can find something interesting or useful from the […]
这是我工作遇到的问题,从别的组里要来了一堆SQL code,大概是四五年前在那工作的人写的,感觉是old style,之前从没见过,贴出来给大家。 Q: What’s the meaning of (+) in SQL queries (Oracle)? A: It’s Oracle’s synonym for OUTER JOIN. Example: SELECT * […]
Let’s learn 3 functions from http://docs.oracle.com 1. nvl(expr1,expr2) nvl lets you replace null (returned as a blank) with a string in the results of a […]
ALTER SESSION ENABLE PARALLEL QUERY; ALTER SESSION SET NLS_DATE_FORMAT=’YYYY-MM-DD HH24:MI:SS’; select table1.contact_id,table1.contact_date,table1.people_login ,count(contact_id) over (partition by people_login order by table1.creation_datetime asc range numtodsinterval(365, ‘day’) preceding) […]
Copyright © 2024 | WordPress Theme by MH Themes