TechnologyApril 10, 2024

Gemini Code Assist + Astra DB: Build Generative AI Apps Faster

The Gemini Code Assist integration, a collaboration with Google Cloud, will enable developers to build applications that use Astra DB faster.
Alan Ho
Alan HoVP Product, AI
Gemini Code Assist + Astra DB: Build Generative AI Apps Faster
CREATE TABLE performers (
  name TEXT PRIMARY KEY,
  type TEXT,
  country TEXT,
  born INT,
  died INT,
  founded INT
);


CREATE TABLE albums_by_performer (
  performer TEXT,
  year INT,
  title TEXT,
  genre TEXT,
  PRIMARY KEY (performer, year, title)
) WITH CLUSTERING ORDER BY (year DESC, title ASC);

CREATE TABLE albums_by_title (
  title TEXT,
  year INT,
  performer TEXT,
  genre TEXT,
  PRIMARY KEY (title, year)
);

CREATE TABLE albums_by_genre (
  genre TEXT,
  year INT,
  title TEXT,
  performer TEXT,
  PRIMARY KEY (genre, year, title)
) WITH CLUSTERING ORDER BY (year DESC);


CREATE TABLE tracks_by_title (
  title TEXT,
  album_year INT,
  album_title TEXT,
  number INT,
  length INT,
  genre TEXT,
  PRIMARY KEY (title, album_year, number)
);


CREATE TABLE tracks_by_album (
  album_title TEXT,
  album_year INT,
  number INT,
  title TEXT,
  length INT,
  genre TEXT STATIC,
  PRIMARY KEY ((album_title, album_year), number)
) WITH CLUSTERING ORDER BY (number ASC);

CREATE TABLE users (
  id UUID PRIMARY KEY,
  name TEXT
);

CREATE TABLE tracks_by_user (
  id UUID,
  month DATE,
  timestamp TIMESTAMP,
  album_title TEXT,
  album_year INT,
  number INT,
  title TEXT,
  length INT,
  PRIMARY KEY ((id, month), timestamp)
) WITH CLUSTERING ORDER BY (timestamp ASC);
Given the above CQL data model, please answer the following question 
with a query if possible. If not possible from the current data model, 
explain why.How many tracks are in 'The Slow Rush' album, 
and how can I listen to them?
Discover more
DataStax Astra DB
Share
JUMP TO SECTION

Get Started Today

One-stop Data API for Production GenAI

Astra DB gives JavaScript developers a complete data API and out-of-the-box integrations that make it easier to build production RAG apps with high relevancy and low latency.