Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Jai Shree Ram Oracle
  • sesswait.sql Oracle
  • ipcs -l Linux/Unix
  • PLSQL Table Syntax 1 Oracle
  • remove archfiles only when it is applied to DR rm_archfiles.sh Linux/Unix
  • To check whether standby is recovering properly or not?? Oracle
  • fuser to check who is using diretory Linux/Unix
  • In Addition to previous note, following grants needed on PERFSTAT user. Oracle
  • sid_wise_cursor.sql find open cursor basis on username or SID Oracle
  • Rollback force for distributed transactions Oracle
  • Oracle Support Metalink ID 161818.1 Oracle
  • purge_trc.sh Linux/Unix
  • New Latest Param.sql for finding all hidden parameters also Oracle
  • Rownum with Order by Oracle
  • switchlogfile.sh Linux/Unix

Getting started with notebook

Posted on 30-Sep-202330-Sep-2023 By Admin No Comments on Getting started with notebook
# Databricks notebook source

 

%sql
create database if not exists abcdb

 

%sql
use abcdb

 

%sql
create table student (id int , name string)

 

%sql
insert into student
select 1 as id, ‘user1’ as name

 

%sql
select * from student

 

spark.sql(“create database if not exists xyzdb”)
spark.sql(“use xyzdb”)

 

# Use three double quotes (“””) if SQL you are using has multiple lines.
spark.sql(“”” create table student1
        ( id int,
        name string )”””)

 

spark.sql(“”” insert into student1
        select 2 as id, ‘test1’ as name””” )

 

# Different format of printing or displaying dataframe.

# Selecting rows from dataframe
spark.sql(“select * from student1”).display()
spark.sql(“select * from student1”).show()

# Storing result-set in collection
spark.sql(“select * from student1”).collect

# Describe schema and datatype
spark.sql(“select * from student1”).printSchema()

 
Python/PySpark

Post navigation

Previous Post: Read CSV file using PySpark
Next Post: Add new columns in dataframe

Related Posts

  • Python class import from different folders Python/PySpark
  • Reading config file from other folder inside class Python/PySpark
  • Read CSV File using Python Python/PySpark
  • Read CSV file using PySpark Python/PySpark
  • Add new columns in dataframe Python/PySpark
  • How to connect to Oracle Database with Wallet with Python. Oracle

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • Ansible (0)
  • AWS (2)
  • Azure (1)
  • Django (0)
  • GIT (1)
  • Linux/Unix (150)
  • MYSQL (5)
  • Oracle (403)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (1)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (18)
  • rman-dataguard (26)
  • shell (151)
  • SQL scripts (349)
  • SQL Server (6)
  • Uncategorized (5)
  • Videos (0)

Recent Posts

  • Key Management in Oracle: The Core Issue: Missing Master Key12-May-2026
  • SAT Mathematics 10 questions and answer at the end.30-Apr-2026
  • top 10 AI news today30-Apr-2026
  • runon_allpdbs_show_conname.sh23-Apr-2026
  • runon_allcdbs_find_pdbs.sh23-Apr-2026
  • Running PDB on single node in RAC09-Apr-2026
  • find_arc.sql09-Apr-2026
  • pvm_pre_change.sql08-Apr-2026
  • find_encr_wallet.sql08-Apr-2026
  • find_pdbs.sql08-Apr-2026

Archives

  • 2026
  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Settting up get_vmstat.sh for colletinf CPU Usage. Oracle
  • lck.sql Oracle
  • How To Transfer Passwords Between Databases (ref note: 199582.1) Oracle
  • How to find the real execution plan and binds used in that explain plan in Oracle 10g?? Oracle
  • pvm_rbs1.sql (to collect rbs info from db) Oracle
  • Checking SQL Server Version SQL Server
  • Jai Shree Ram Oracle
  • ORA-1841 Error Connecting to Upgraded Database After Set PASSWORD_LIFE_TIME Oracle

Copyright © 2026 pvmehta.com.

Powered by PressBook News WordPress theme