Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scripts sql finalizados #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

Jand-S
Copy link

@Jand-S Jand-S commented Nov 10, 2021

No description provided.

Copy link
Collaborator

@gcestaro gcestaro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parabéns pela entrega! 👏

*/

SELECT l.titulo AS LIVRO FROM livros l
WHERE l.titulo LIKE '%java%';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e se tiver JAVA ou Java, funciona?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Funciona, o LIKE por padrão não é case-sensitive

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Legal, cuidado que isso não é uma verdade em todos os bancos de dados. No Oracle, até a versão 12c por exemplo, não é.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blz


CREATE TABLE IF NOT EXISTS emprestimos(
id_e INT AUTO_INCREMENT NOT NULL,
livro VARCHAR(17) NOT NULL,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

é legal ter uma referência de o que está usando do livro, usuário e outras FKs. Exemplo: ao invés de livro, poderia usar isbn_livro ou id_livro, pq só livro poderia ser qualquer coluna da tabela livro, geralmente o id, mas vale deixar explícito :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants