blog.itcode.devblog.itcode.dev

[Programmers / MySQL] Level 1 Retrieve All Records (59034)

The ANIMAL_INS table holds information about animals that have come into an animal shelter. The ANIMAL_INS table structure is as follows, where ANIMAL_ID, ANIMAL_TYPE, DATETIME, INTAKE_CONDITION, NAME, and SEX_UPON_INTAKE represent the animal's ID, species, intake date, condition at intake, name, and sex/neuter status, respectively.

[Programmers / MySQL] Level 1 Retrieve All Records (59034)

The ANIMAL_INS table holds information about animals that have come into an animal shelter. The ANIMAL_INS table structure is as follows, where ANIMAL_ID, ANIMAL_TYPE, DATETIME, INTAKE_CONDITION, NAME, and SEX_UPON_INTAKE represent the animal's ID, species, intake date, condition at intake, name, and sex/neuter status, respectively.
RWB0104
@RWBwritten at 2021-12-14 16:38:22
Programmers

시리즈 모아보기

Programmers

14 / 78
RankLanguage Used
Level 1

🖼️ MySQL

🔗 Retrieve All Records

The ANIMAL_INS table holds information about animals that have come into an animal shelter. The ANIMAL_INS table structure is as follows, where ANIMAL_ID, ANIMAL_TYPE, DATETIME, INTAKE_CONDITION, NAME, and SEX_UPON_INTAKE represent the animal's ID, species, intake date, condition at intake, name, and sex/neuter status, respectively.

NAMETYPENULLABLE
ANIMAL_IDVARCHAR(N)FALSE
ANIMAL_TYPEVARCHAR(N)FALSE
DATETIMEDATETIMEFALSE
INTAKE_CONDITIONVARCHAR(N)FALSE
NAMEVARCHAR(N)TRUE
SEX_UPON_INTAKEVARCHAR(N)FALSE

Write an SQL statement that retrieves information for every animal that came into the shelter, ordered by ANIMAL_ID. Running the SQL should produce output like the following.

ANIMAL_IDANIMAL_TYPEDATETIMEINTAKE_CONDITIONNAMESEX_UPON_INTAKE
A349996Cat2018-01-22 14:32:00NormalSugarNeutered Male
A350276Cat2017-08-13 13:50:00NormalJewelSpayed Female
A350375Cat2017-03-06 15:01:00NormalMeoNeutered Male
A352555Dog2014-08-08 04:20:00NormalHarleySpayed Female

..omitted below

Query ANIMAL_INS, ordered by ANIMAL_ID.

SQL

SELECT * FROM ANIMAL_INS ORDER BY ANIMAL_ID;
# Programmers# Algorithm# SQL# Level 1
ship
blog.itcode.dev

Notes from the π-th Alpaca

7.0.1
Developed by RWB since 2021.057th upgraded at 2026.08