Code Monkey home page Code Monkey logo

domanrovil-selectcolumns's Introduction

Background

SQL sublanguage: DQL (Data Query Language)

We have learned how to query all records from a table as well as filter the amount of records we get back utilizing the WHERE keyword.

In this lab we are going to learn how to filter the amount of columns that we want returned.

Let's take a look at the syntax to return an entire table again:

 SELECT * FROM table_name;

In the statement above, the * is the wildcard to retrieve all the columns in this specific table. However, we can specify the columns that we want to display by the following syntax:

 SELECT col_1, col_2, ...col_N FROM table_name;

Additional reference material if needed: https://www.w3schools.com/sql/sql_select.asp


Lab

Problem 1

site_user table

id firstname lastname
1 'Steve' 'Garcia'
2 'Alexa' 'Smith'
3 'Steve' 'Jones'
4 'Brandon' 'Smith'
5 'Adam' 'Jones'

Problem 1: Write the SQL statement to return only the 'firstname' column from the site_user table

domanrovil-selectcolumns's People

Contributors

domanrovil avatar kevinchilds avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.